import { nanoid } from 'nanoid'
//使用自定义的字符进行随机
import { customAlphabet } from "nanoid";

export const AutoId = ():String => {
    let id = nanoid();
    return id;
}

export const CustomId = ():String => {
    let nanoid = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyz", 7);
    let id = nanoid();
    return id;
}

export const CustomIdPrefix = (prefix: String):String => {
    let nanoid = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyz", 7);
    let id = nanoid();
    return `${prefix}_${id}`;
}